////////////////////////////////////////////////
// DESCRIPTION:
//    HardwareProvider for the Tahoe platform
//
// Legal Notices:
//   Copyright (c) 2008, Telliam Consulting, LLC.
//   All rights reserved.
//
//   Redistribution and use in source and binary forms, with or without modification,
//   are permitted provided that the following conditions are met:
//
//   * Redistributions of source code must retain the above copyright notice, this list
//     of conditions and the following disclaimer.
//   * Redistributions in binary form must reproduce the above copyright notice, this
//     list of conditions and the following disclaimer in the documentation and/or other
//     materials provided with the distribution.
//   * Neither the name of Telliam Consulting nor the names of its contributors may be
//     used to endorse or promote products derived from this software without specific
//     prior written permission.
//
//   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
//   EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
//   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
//   SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
//   TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
//   BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
//   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
//   ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
//   DAMAGE. 
//

using System;
using System.Threading;

using Microsoft.SPOT;
using Microsoft.SPOT.Input;
using Microsoft.SPOT.Hardware;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Media;

using FusionWare.SPOT.Hardware;
using FusionWare.SPOT.Bouncy.Properties;

namespace FusionWare.SPOT.Bouncy
{
    #region Application
    /// <summary>Core apllication object for the application</summary>
    /// <remarks> This application serves as a sample for a number of features and
    /// functionality of the .NET Micro Framework including 
    /// <list type="bullet">
    /// <item><description>The FusionWare.Application WPF style application class</description></item>
    /// <item><description>WPF style windowing and event handling</description></item>
    /// <item><description>The FusionWare.Hardware namespace</description></item>
    /// <item><description>Efficient annimation of graphics in a window</description></item>
    /// <item><description>General template for GUI based applications</description></item>
    /// </list>
    /// </remarks>
    public class App : FusionWare.SPOT.Application
    {
        #region Application Entry Point
        /// <summary>Main entry point for the application</summary>
        public static void Main()
        {
            // Init and run the application main window
            App theApp = new App();
            theApp.Run(theApp.MainWindow);
        }
        #endregion

        #region Constructor
        /// <summary>Constructor for the application object</summary>
        /// <remarks>
        /// Creates a new Full Screen BouncyViewWindow as the
        /// main window for the application.
        /// </remarks>
        App() : base(App.ButtonDefs)
        {
            this.MainWindow = new BouncyViewWindow();
            this.MainWindow.Height = SystemMetrics.ScreenHeight;
            this.MainWindow.Width = SystemMetrics.ScreenWidth;
        }
        #endregion

        #region Button Definitions
        /// <summary>Button Definitions for this application</summary>
        /// <remarks>
        /// For Demo purposes defines all the directions and select button. 
        /// Currently the only one actually used in this application is the select button.
        /// </remarks>
        static ButtonDefinition[] ButtonDefs = {
                //new ButtonDefinition(Button.Up, true, Tahoe.Pins.SW5),
                //new ButtonDefinition(Button.Left, true, Tahoe.Pins.SW6),
                //new ButtonDefinition(Button.Select, false, Tahoe.Pins.SW7),
                //new ButtonDefinition(Button.Right, true, Tahoe.Pins.SW8),
                //new ButtonDefinition(Button.Down, true, Tahoe.Pins.SW9) 
        };
        #endregion
    }
    #endregion
}
